package com.lanp.gencode.test;

import com.alibaba.fastjson.JSON;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

public class T33 {
    public static void main(String[] args) {
        List<User> users = Arrays.asList(
                new User(3l, "3"),
                new User(null, "1"),
                new User(2l, "2")
        );

        users.sort(Comparator.comparingLong(User::getAge).reversed());

        System.out.println(JSON.toJSONString(users));
    }


}
